home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * Celestial Mechanics Simulation Tool
- *
- * W. John Guineau
- * 3 Royal Crest Drive #9
- * Marlboro, Mass. 01752
- * (508) 485-6233
- *
- * Files:
- * cm.c
- * cm.h
- * cm.doc
- *
- * To Compile with Lattice 5.02:
- *
- * lc -b0 -Lm cm
- *
- * NOTICE
- * ------
- *
- * I have placed this software in the Public Domain with the
- * condition that all the files remain together and that I remain
- * listed as the original author. This software may not be used for
- * commercial purposes or to make money in any way without expressed
- * written permission from the author (me). I'm including the source
- * code so if you make any significant modifications please concider
- * sending me a copy at the above address. I'd also be interested in
- * any interesting saved setup files you create.
- *
- *
- * This is my first Amiga program so I welcome any comments at all.
- * I wrote this program as both a way to learn the Amiga environment
- * and in response to a conversation I had with a friend on Celestial
- * Mechanics.
- *
- *
- */
-
-
-
-
-
-
- #define BLKPEN 0
- #define WHTPEN 1
- #define REDPEN 2
- #define ORGPEN 3
- #define YLWPEN 4
- #define GRNPEN 5
- #define BLUPEN 6
- #define PURPEN 7
-
- #define REQBCK ORGPEN
-
- #define SX 640
- #define SY 400
- #define STE 12
- #define SD 3
- #define COLORS 8
-
- #define PX 220
- #define PY STE
- #define PW 200
- #define PH 12
-
-
-
- #define MAX_X 630
- #define MAX_Y 340
-
-
-
- USHORT colortable[COLORS] = {
- 0x000, /* BLKPEN */
- 0xfff, /* WHTPEN */
- 0xf00, /* REDPEN */
- 0xf90, /* ORGPEN */
- 0xff0, /* YLWPEN */
- 0x0f0, /* GRNPEN */
- 0x00f, /* BLUPEN */
- 0xf0f /* PURPEN */
- };
- UWORD *cp; /* color palette */
-
-
-
- /*
- * Screen and Windows
- */
-
- struct NewScreen ns = {
- 0,0, /* Left, top */
- SX,SY,SD, /* width,height,depth */
- ORGPEN,WHTPEN, /* detail and block pens */
- HIRES|LACE, /* mode (max pixels!) */
- CUSTOMSCREEN, /* type */
- NULL, /* fonts? */
- "Celestial Mechanics V1.0",
- NULL, /* gadgets? */
- NULL /* bitmap? */
-
- };
-
-
- #define IDCMPFL (CLOSEWINDOW|MOUSEBUTTONS|MENUPICK|GADGETUP|REQCLEAR)
- #define IDCMPFL_MM (CLOSEWINDOW|MOUSEBUTTONS|MENUPICK|GADGETUP|REQCLEAR|MOUSEMOVE)
-
-
-
- struct NewWindow nw = {
- 0,STE, /* Start position */
- SX,SY-STE, /* width, height, */
- BLKPEN,WHTPEN, /* detail, block pens */
- /* IDCMP flags */
- IDCMPFL,
-
- GIMMEZEROZERO
- | ACTIVATE
- | REPORTMOUSE
- | WINDOWCLOSE
- | SMART_REFRESH,
-
- NULL, /* First gadget in list */
- NULL, /* User checkmark */
- "Gravitational Behaviour",/* Window Title */
- NULL, /* Pointer to screen (Set later) */
- NULL, /* Pointer to superbitmap */
- 0,0,0,0, /* Ignored because not sizeable */
- CUSTOMSCREEN /* on our own screen */
- };
-
- struct NewWindow npw = {
- PX,PY, /* Start position */
- PW,PH, /* width, height, */
- ORGPEN,REDPEN, /* detail, block pens */
-
- NULL, /* IDCMP flags */
-
- BORDERLESS
- | NOCAREREFRESH,
-
- NULL, /* First gadget in list */
- NULL, /* User checkmark */
- NULL, /* Window Title */
- NULL, /* Pointer to screen (Set later) */
- NULL, /* Pointer to superbitmap */
- 0,0,0,0, /* Ignored because not sizeable */
- CUSTOMSCREEN /* on our own screen */
- };
-
-
-
-
-
-
- /*
- * Text Attributes
- */
- char def_font[] ="topaz.font";
-
- struct TextAttr TxtAt_Plain = {
- (UBYTE *)def_font,
- 8,
- FS_NORMAL,
- FPF_ROMFONT
- };
-
- struct TextAttr TxtAt_BIU = {
- (UBYTE *)def_font,
- 8,
- FSF_BOLD | FSF_ITALIC | FSF_UNDERLINED,
- FPF_ROMFONT
- };
-
- struct TextAttr TxtAt_BU = {
- (UBYTE *)def_font,
- 8,
- FSF_BOLD | FSF_UNDERLINED,
- FPF_ROMFONT
- };
-
- struct TextAttr TxtAt_BI = {
- (UBYTE *)def_font,
- 8,
- FSF_BOLD | FSF_ITALIC,
- FPF_ROMFONT
- };
-
- struct TextAttr TxtAt_B ={
- (UBYTE *)def_font,
- 8,
- FSF_BOLD,
- FPF_ROMFONT
- };
-
- struct TextAttr TxtAt_IU ={
- (UBYTE *)def_font,
- 8,
- FSF_ITALIC | FSF_UNDERLINED,
- FPF_ROMFONT
- };
-
- struct TextAttr TxtAt_I ={
- (UBYTE *)def_font,
- 8,
- FSF_ITALIC,
- FPF_ROMFONT
- };
-
- struct TextAttr TxtAt_U ={
- (UBYTE *)def_font,
- 8,
- FSF_UNDERLINED,
- FPF_ROMFONT
- };
-
-
-
-
-
-
- /**************************************
- * Gadgets
- **************************************/
-
- /*
- * Gadget ID numbers
- */
- #define NAMEGAD 1
- #define RADIUSGAD 2
- #define MASSGAD 3
- #define VELOCITYGAD 4
- #define DIRECTIONGAD 5
- #define OKGAD 6
- #define CANCELGAD 7
- #define RESETGAD 8
- #define GGAD 9
- #define DTGAD 10
- #define TGAD 11
- #define DSGAD 12
- #define TLGAD 13
- #define COLOR1GAD 14
- #define COLOR2GAD 15
- #define COLOR3GAD 16
- #define COLOR4GAD 17
- #define COLOR5GAD 18
- #define COLOR6GAD 19
- #define COLOR7GAD 20
- #define FNGAD 21
- #define FNOKGAD 22
- #define FNCANGAD 23
- #define STGAD 24
- #define FXGAD 25
- #define AOKGAD 26
-
-
-
- /*
- * Some common gadget stuff
- */
- struct IntuiText yes_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 3,3, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Yes", /* IText */
- NULL /* NextText */
- };
-
- struct IntuiText no_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 7,3, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "No", /* IText */
- NULL /* NextText */
- };
-
-
- /*
- * cancel gadget
- */
-
- SHORT cancel_Pairs[] = {
- 0, 0,
- 68,0,
- 68,22,
- 0, 22,
- 0, 0
- };
-
- struct Border cancel_bord = {
- -1, -1, /* LeftEdge, TopEdge */
- REDPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode */
- 5, /* Count of XY pairs */
- (SHORT *)&cancel_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- char *cantxt="CANCEL"; /* This gad is either CAN or DEL */
- char *deltxt="DELETE";
-
- struct IntuiText cancel_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 9,8, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- NULL, /* IText */
- NULL /* NextText */
- };
-
- struct Gadget cancel = {
- NULL, /* NextGadget pointer */
- 130, 115, /* LeftEdge, TopEdge */
- 68, 22, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | ENDGADGET,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&cancel_bord, /* GadgetRender */
- NULL, /* SelectRender */
- &cancel_text, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- CANCELGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
- /*
- * ok gadget
- */
-
- SHORT ok_Pairs[] = {
- 0, 0,
- 30,0,
- 30,22,
- 0, 22,
- 0, 0
- };
-
- struct Border ok_bord = {
- -1, -1, /* LeftEdge, TopEdge */
- GRNPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY p airs */
- (SHORT *)&ok_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText ok_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 5,7, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "OK", /* IText */
- NULL /* NextText */
- };
-
-
- struct Gadget ok = {
- &cancel, /* NextGadget pointer */
- 15, 115, /* LeftEdge, TopEdge */
- 30, 22, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | ENDGADGET,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&ok_bord, /* GadgetRender */
- NULL, /* SelectRender */
- &ok_text, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- OKGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
-
-
- /*
- * reset gadget
- */
-
- SHORT reset_Pairs[] = {
- 0, 0,
- 51,0,
- 51,22,
- 0, 22,
- 0, 0
- };
-
- struct Border reset_bord = {
- -1, -1, /* LeftEdge, TopEdge */
- YLWPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&reset_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText reset_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 5,7, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "RESET", /* IText */
- NULL /* NextText */
- };
-
-
- struct Gadget reset = {
- &ok, /* NextGadget pointer */
- 60, 115, /* LeftEdge, TopEdge */
- 51, 22, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&reset_bord, /* GadgetRender */
- NULL, /* SelectRender */
- &reset_text, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- RESETGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
-
- /****************************************************
- * Gadgets in Body Requestor
- ****************************************************/
-
-
-
-
- /*
- * Text for x,y printout in Body req
- */
- char xy_buf[80];
- struct IntuiText xy_text = {
- BLUPEN,WHTPEN, /* FrontPen, BackPen */
- JAM2, /* DrawMode */
- 15,96, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- xy_buf, /* IText */
- NULL /* NextText */
- };
-
-
-
- /*
- * Fixed gadget
- */
-
- struct Image fx_image = {
- 0,0, /* relative to select box */
- 30,11, /* same size as select box */
- SD, /* planes deep as screen */
- NULL, /* image data, but we don't need it */
- 0x00, /* planepick- none */
- BLUPEN, /* planeonoff */
- NULL /* next image, none */
- };
-
- struct IntuiText fx_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,82, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Fixed", /* IText */
- &xy_text /* NextText */
- };
-
-
- struct Gadget fixed = {
- &reset, /* NextGadget pointer */
- 140, 80, /* LeftEdge, TopEdge */
- 30, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHNONE
- | GADGIMAGE,
- /* Activation Flags */
- TOGGLESELECT
- | RELVERIFY,
-
- BOOLGADGET /* GadgetType */
- | REQGADGET,
- (APTR)&fx_image, /* GadgetRender */
- NULL, /* SelectRender */
- &no_text, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- FXGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
- /*
- * Color gadgets
- */
-
- struct IntuiText color_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,65, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "COLOR", /* IText */
- &fx_text /* NextText */
- };
-
-
- struct Image color1_image = {
- 0,0, /* relative to select box */
- 10,11, /* same size as select box */
- SD, /* planes deep as screen */
- NULL, /* image data, but we don't need it */
- 0x00, /* planepick- none */
- 0x1, /* planeonoff */
- NULL /* next image, none */
- };
-
-
- struct Gadget color1 = {
- &fixed, /* NextGadget pointer */
- 119, 63, /* LeftEdge, TopEdge */
- 10, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP
- | GADGIMAGE,
- /* Activation Flags */
- RELVERIFY,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&color1_image, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- COLOR1GAD, /* GadgetID */
- (APTR)WHTPEN /* UserData Pointer */
- };
-
-
- struct Image color2_image = {
- 0,0, /* relative to select box */
- 10,11, /* same size as select box */
- SD, /* planes deep as screen */
- NULL, /* image data, but we don't need it */
- 0x00, /* planepick- none */
- 0x2, /* planeonoff */
- NULL /* next image, none */
- };
-
-
- struct Gadget color2 = {
- &color1, /* NextGadget pointer */
- 129, 63, /* LeftEdge, TopEdge */
- 10, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP
- | GADGIMAGE,
- /* Activation Flags */
- RELVERIFY,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&color2_image, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- COLOR2GAD, /* GadgetID */
- (APTR)REDPEN /* UserData Pointer */
- };
-
-
- struct Image color3_image = {
- 0,0, /* relative to select box */
- 10,11, /* same size as select box */
- SD, /* planes deep as screen */
- NULL, /* image data, but we don't need it */
- 0x00, /* planepick- none */
- 0x3, /* planeonoff */
- NULL /* next image, none */
- };
-
-
- struct Gadget color3 = {
- &color2, /* NextGadget pointer */
- 139, 63, /* LeftEdge, TopEdge */
- 10, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP
- | GADGIMAGE,
- /* Activation Flags */
- RELVERIFY,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&color3_image, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- COLOR3GAD, /* GadgetID */
- (APTR)ORGPEN /* UserData Pointer */
- };
-
-
- struct Image color4_image = {
- 0,0, /* relative to select box */
- 10,11, /* same size as select box */
- SD, /* planes deep as screen */
- NULL, /* image data, but we don't need it */
- 0x00, /* planepick- none */
- 0x4, /* planeonoff */
- NULL /* next image, none */
- };
-
-
- struct Gadget color4 = {
- &color3, /* NextGadget pointer */
- 149, 63, /* LeftEdge, TopEdge */
- 10, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP
- | GADGIMAGE,
- /* Activation Flags */
- RELVERIFY,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&color4_image, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- COLOR4GAD, /* GadgetID */
- (APTR)YLWPEN /* UserData Pointer */
- };
-
-
- struct Image color5_image = {
- 0,0, /* relative to select box */
- 10,11, /* same size as select box */
- SD, /* planes deep as screen */
- NULL, /* image data, but we don't need it */
- 0x00, /* planepick- none */
- 0x5, /* planeonoff */
- NULL /* next image, none */
- };
-
-
- struct Gadget color5 = {
- &color4, /* NextGadget pointer */
- 159, 63, /* LeftEdge, TopEdge */
- 10, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP
- | GADGIMAGE,
- /* Activation Flags */
- RELVERIFY,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&color5_image, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- COLOR5GAD, /* GadgetID */
- (APTR)GRNPEN /* UserData Pointer */
- };
-
-
- struct Image color6_image = {
- 0,0, /* relative to select box */
- 10,11, /* same size as select box */
- SD, /* planes deep as screen */
- NULL, /* image data, but we don't need it */
- 0x00, /* planepick- none */
- 0x6, /* planeonoff */
- NULL /* next image, none */
- };
-
-
- struct Gadget color6 = {
- &color5, /* NextGadget pointer */
- 169, 63, /* LeftEdge, TopEdge */
- 10, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP
- | GADGIMAGE,
- /* Activation Flags */
- RELVERIFY,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&color6_image, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- COLOR6GAD, /* GadgetID */
- (APTR)BLUPEN /* UserData Pointer */
- };
-
-
- struct Image color7_image = {
- 0,0, /* relative to select box */
- 10,11, /* same size as select box */
- SD, /* planes deep as screen */
- NULL, /* image data, but we don't need it */
- 0x00, /* planepick- none */
- 0x7, /* planeonoff */
- NULL /* next image, none */
- };
-
-
- struct Gadget color7 = {
- &color6, /* NextGadget pointer */
- 179, 63, /* LeftEdge, TopEdge */
- 10, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP
- | GADGIMAGE,
- /* Activation Flags */
- RELVERIFY,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&color7_image, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- COLOR7GAD, /* GadgetID */
- (APTR)PURPEN /* UserData Pointer */
- };
-
-
-
- /*
- * direction gadget
- */
-
- SHORT direction_Pairs[] = {
- 0, 0,
- 90,0,
- 90,13,
- 0, 13,
- 0, 0
- };
-
- struct Border direction_bord = {
- -1, -3, /* LeftEdge, TopEdge */
- WHTPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&direction_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText dir_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,47, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "DIRECTION", /* IText */
- &color_text /* NextText */
- };
-
-
- UBYTE direction_sbuf[12] = "0";
- UBYTE direction_ubuf[12];
-
- struct StringInfo direction_txstr = {
- direction_sbuf, direction_ubuf, /* Buffer, UndoBuffer */
- 0, 12, 0, /* BufferPos, MaxChars, DispPos */
- 0, 1, /* UndoPos, NumChars */
- 0, 0, 0, /* DispCount, CLeft, CTop */
- 0x0, 0, /* LayerPtr, LongInt */
- NULL /* AltKeyMap */
- };
-
- struct Gadget direction = {
- &color7, /* NextGadget pointer */
- 110, 45, /* LeftEdge, TopEdge */
- 88, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | LONGINT
- | STRINGCENTER,
- /* GadgetType */
- STRGADGET
- | REQGADGET,
- (APTR)&direction_bord, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- (APTR)&direction_txstr, /* SpecialInfo */
- DIRECTIONGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
- /*
- * velocity gadget
- */
-
- SHORT velocity_Pairs[] = {
- 0, 0,
- 90,0,
- 90,13,
- 0, 13,
- 0, 0
- };
-
- struct Border velocity_bord = {
- -1, -3, /* LeftEdge, TopEdge */
- WHTPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&velocity_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText vel_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,34, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "VELOCITY", /* IText */
- &dir_text /* NextText */
- };
-
-
- UBYTE velocity_sbuf[20] = "0.0e0";
- UBYTE velocity_ubuf[20];
-
- struct StringInfo velocity_txstr = {
- velocity_sbuf, velocity_ubuf, /* Buffer, UndoBuffer */
- 0, 20, 0, /* BufferPos, MaxChars, DispPos */
- 0, 5, /* UndoPos, NumChars */
- 0, 0, 0, /* DispCount, CLeft, CTop */
- 0x0, 0, /* LayerPtr, LongInt */
- NULL /* AltKeyMap */
- };
-
-
- struct Gadget velocity = {
- &direction, /* NextGadget pointer */
- 110, 32, /* LeftEdge, TopEdge */
- 88, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | STRINGCENTER,
- /* GadgetType */
- STRGADGET
- | REQGADGET,
- (APTR)&velocity_bord, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- (APTR)&velocity_txstr, /* SpecialInfo */
- VELOCITYGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
- /*
- * name gadget
- */
-
- SHORT name_Pairs[] = {
- 0, 0,
- 90,0,
- 90,13,
- 0, 13,
- 0, 0
- };
-
- struct Border name_bord = {
- -1, -3, /* LeftEdge, TopEdge */
- WHTPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&name_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText name_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,8, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "NAME", /* IText */
- &vel_text /* NextText */
- };
-
- UBYTE name_sbuf[12] = "SUN";
- UBYTE name_ubuf[12];
-
- struct StringInfo name_txstr = {
- name_sbuf, name_ubuf, /* Buffer, UndoBuffer */
- 0, 12, 0, /* BufferPos, MaxChars, DispPos */
- 0, 3, /* UndoPos, NumChars */
- 0, 0, 0, /* DispCount, CLeft, CTop */
- 0x0, 0, /* LayerPtr, LongInt */
- NULL /* AltKeyMap */
- };
-
- struct Gadget name= {
- &velocity, /* NextGadget pointer */
- 110, 6, /* LeftEdge, TopEdge */
- 88, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | STRINGCENTER,
- /* GadgetType */
- STRGADGET
- | REQGADGET,
- (APTR)&name_bord, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- (APTR)&name_txstr, /* SpecialInfo */
- NAMEGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
-
-
- /*
- * mass gadget
- */
-
- SHORT mass_Pairs[] = {
- 0, 0,
- 90,0,
- 90,13,
- 0, 13,
- 0, 0
- };
-
- struct Border mass_bord = {
- -1, -3, /* LeftEdge, TopEdge */
- WHTPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&mass_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText mass_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,21, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "MASS", /* IText */
- &name_text /* NextText */
- };
-
- UBYTE mass_sbuf[20] = "1.0e0";
- UBYTE mass_ubuf[20];
-
- struct StringInfo mass_txstr = {
- mass_sbuf, mass_ubuf, /* Buffer, UndoBuffer */
- 0, 20, 0, /* BufferPos, MaxChars, DispPos */
- 0, 5, /* UndoPos, NumChars */
- 0, 0, 0, /* DispCount, CLeft, CTop */
- 0x0, 1, /* LayerPtr, LongInt */
- NULL /* AltKeyMap */
- };
-
- struct Gadget mass = {
- &name, /* NextGadget pointer */
- 110, 19, /* LeftEdge, TopEdge */
- 88, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | STRINGCENTER,
- /* GadgetType */
- STRGADGET
- | REQGADGET,
- (APTR)&mass_bord, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- (APTR)&mass_txstr, /* SpecialInfo */
- MASSGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
-
- /****************************************************
- * Gadgets in Setup Requestor
- ****************************************************/
-
-
- /*
- * ShowTime gadget
- */
-
- struct Image st_image = {
- 0,0, /* relative to select box */
- 30,11, /* same size as select box */
- SD, /* planes deep as screen */
- NULL, /* image data, but we don't need it */
- 0x00, /* planepick- none */
- BLUPEN, /* planeonoff */
- NULL /* next image, none */
- };
-
- struct IntuiText st_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,98, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "ShowTime", /* IText */
- NULL /* NextText */
- };
-
-
- struct Gadget st = {
- &reset, /* NextGadget pointer */
- 145, 96, /* LeftEdge, TopEdge */
- 30, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHNONE
- | GADGIMAGE,
- /* Activation Flags */
- TOGGLESELECT
- | RELVERIFY,
-
- BOOLGADGET /* GadgetType */
- | REQGADGET,
- (APTR)&st_image, /* GadgetRender */
- NULL, /* SelectRender */
- &no_text, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- STGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
- /*
- * TrailLength gadget
- */
-
- SHORT tl_Pairs[] = {
- 0, 0,
- 90,0,
- 90,13,
- 0, 13,
- 0, 0
- };
-
- struct Border tl_bord = {
- -1, -3, /* LeftEdge, TopEdge */
- WHTPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&tl_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
-
- UBYTE tl_sbuf[20] = "0";
- UBYTE tl_ubuf[20];
-
- struct StringInfo tl_txstr = {
- tl_sbuf, tl_ubuf, /* Buffer, UndoBuffer */
- 0, 20, 0, /* BufferPos, MaxChars, DispPos */
- 0, 1, /* UndoPos, NumChars */
- 0, 0, 0, /* DispCount, CLeft, CTop */
- 0x0, 1, /* LayerPtr, LongInt */
- NULL /* AltKeyMap */
- };
-
- struct IntuiText tl_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,60, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "TrailLength", /* IText */
- &st_text /* NextText */
- };
-
-
- struct Gadget tl = {
- &st, /* NextGadget pointer */
- 110, 58, /* LeftEdge, TopEdge */
- 88, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | LONGINT
- | STRINGCENTER,
- /* GadgetType */
- STRGADGET
- | REQGADGET,
- (APTR)&tl_bord, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- (APTR)&tl_txstr, /* SpecialInfo */
- TLGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
- /*
- * ds (Delta S) gadget
- */
-
- SHORT ds_Pairs[] = {
- 0, 0,
- 90,0,
- 90,13,
- 0, 13,
- 0, 0
- };
-
- struct Border ds_bord = {
- -1, -3, /* LeftEdge, TopEdge */
- WHTPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&ds_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText ds_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,47, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Units/Pixel", /* IText */
- &tl_text /* NextText */
- };
-
-
- UBYTE ds_sbuf[20] = "1.0e0";
- UBYTE ds_ubuf[20];
-
- struct StringInfo ds_txstr = {
- ds_sbuf, ds_ubuf, /* Buffer, UndoBuffer */
- 0, 20, 0, /* BufferPos, MaxChars, DispPos */
- 0, 5, /* UndoPos, NumChars */
- 0, 0, 0, /* DispCount, CLeft, CTop */
- 0x0, 1, /* LayerPtr, LongInt */
- NULL /* AltKeyMap */
- };
-
- struct Gadget ds = {
- &tl, /* NextGadget pointer */
- 110, 45, /* LeftEdge, TopEdge */
- 88, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | STRINGCENTER,
- /* GadgetType */
- STRGADGET
- | REQGADGET,
- (APTR)&ds_bord, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- (APTR)&ds_txstr, /* SpecialInfo */
- DSGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
- /*
- * t_gadget
- */
-
- SHORT t_Pairs[] = {
- 0, 0,
- 90,0,
- 90,13,
- 0, 13,
- 0, 0
- };
-
- struct Border t_bord = {
- -1, -3, /* LeftEdge, TopEdge */
- WHTPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&t_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText t_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,34, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Real Time", /* IText */
- &ds_text /* NextText */
- };
-
-
- UBYTE t_sbuf[12] = "0";
- UBYTE t_ubuf[12];
-
- struct StringInfo t_txstr = {
- t_sbuf, t_ubuf, /* Buffer, UndoBuffer */
- 0, 12, 0, /* BufferPos, MaxChars, DispPos */
- 0, 1, /* UndoPos, NumChars */
- 0, 0, 0, /* DispCount, CLeft, CTop */
- 0x0, 0, /* LayerPtr, LongInt */
- NULL /* AltKeyMap */
- };
-
-
- struct Gadget t = {
- &ds, /* NextGadget pointer */
- 110, 32, /* LeftEdge, TopEdge */
- 88, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | LONGINT
- | STRINGCENTER,
- /* GadgetType */
- STRGADGET
- | REQGADGET,
- (APTR)&t_bord, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- (APTR)&t_txstr, /* SpecialInfo */
- TGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
- /*
- * G gadget
- */
-
- SHORT G_Pairs[] = {
- 0, 0,
- 90,0,
- 90,13,
- 0, 13,
- 0, 0
- };
-
- struct Border G_bord = {
- -1, -3, /* LeftEdge, TopEdge */
- WHTPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&G_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText G_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,8, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Gravity (G)", /* IText */
- &t_text /* NextText */
- };
-
- UBYTE G_sbuf[20] = "6.67e0";
- UBYTE G_ubuf[20];
-
- struct StringInfo G_txstr = {
- G_sbuf, G_ubuf, /* Buffer, UndoBuffer */
- 0, 20, 0, /* BufferPos, MaxChars, DispPos */
- 0, 6, /* UndoPos, NumChars */
- 0, 0, 0, /* DispCount, CLeft, CTop */
- 0x0, 0, /* LayerPtr, LongInt */
- NULL /* AltKeyMap */
- };
-
- struct Gadget G = {
- &t, /* NextGadget pointer */
- 110, 6, /* LeftEdge, TopEdge */
- 88, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | STRINGCENTER,
- /* GadgetType */
- STRGADGET
- | REQGADGET,
- (APTR)&G_bord, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- (APTR)&G_txstr, /* SpecialInfo */
- GGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
-
-
- /*
- * dt gadget
- */
-
- SHORT dt_Pairs[] = {
- 0, 0,
- 90,0,
- 90,13,
- 0, 13,
- 0, 0
- };
-
- struct Border dt_bord = {
- -1, -3, /* LeftEdge, TopEdge */
- WHTPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&dt_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText dt_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 10,21, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Sim Time", /* IText */
- &G_text /* NextText */
- };
-
- UBYTE dt_sbuf[20] = "1.0e0";
- UBYTE dt_ubuf[20];
-
- struct StringInfo dt_txstr = {
- dt_sbuf, dt_ubuf, /* Buffer, UndoBuffer */
- 0, 20, 0, /* BufferPos, MaxChars, DispPos */
- 0, 5, /* UndoPos, NumChars */
- 0, 0, 0, /* DispCount, CLeft, CTop */
- 0x0, 1, /* LayerPtr, LongInt */
- NULL /* AltKeyMap */
- };
-
- struct Gadget dt = {
- &G, /* NextGadget pointer */
- 110, 19, /* LeftEdge, TopEdge */
- 88, 11, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | STRINGCENTER,
- /* GadgetType */
- STRGADGET
- | REQGADGET,
- (APTR)&dt_bord, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- (APTR)&dt_txstr, /* SpecialInfo */
- DTGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
-
-
-
- /*
- * FileName cancel gadget
- */
-
- SHORT fncancel_Pairs[] = {
- 0, 0,
- 68,0,
- 68,22,
- 0, 22,
- 0, 0
- };
-
- struct Border fncancel_bord = {
- -1, -1, /* LeftEdge, TopEdge */
- REDPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode */
- 5, /* Count of XY pairs */
- (SHORT *)&fncancel_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText fncancel_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 9,8, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "CANCEL", /* IText */
- NULL /* NextText */
- };
-
- struct Gadget fncancel = {
- NULL, /* NextGadget pointer */
- 230, 35, /* LeftEdge, TopEdge */
- 68, 22, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | ENDGADGET,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&fncancel_bord, /* GadgetRender */
- NULL, /* SelectRender */
- &fncancel_text, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- FNCANGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
- /*
- * fnok gadget
- */
-
- SHORT fnok_Pairs[] = {
- 0, 0,
- 30,0,
- 30,22,
- 0, 22,
- 0, 0
- };
-
- struct Border fnok_bord = {
- -1, -1, /* LeftEdge, TopEdge */
- GRNPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&fnok_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText fnok_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 5,7, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "OK", /* IText */
- NULL /* NextText */
- };
-
-
- struct Gadget fnok = {
- &fncancel, /* NextGadget pointer */
- 100, 35, /* LeftEdge, TopEdge */
- 30, 22, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | ENDGADGET,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&fnok_bord, /* GadgetRender */
- NULL, /* SelectRender */
- &fnok_text, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- FNOKGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
-
-
-
- /*
- * FileName gadget
- */
-
- SHORT fn_Pairs[] = {
- 0, 0,
- 300,0,
- 300,10,
- 0, 10,
- 0, 0
- };
-
- struct Border fn_bord = {
- -1, -1, /* LeftEdge, TopEdge */
- YLWPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&fn_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText fn_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 140,5, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Data File Name?", /* IText */
- NULL /* NextText */
- };
-
-
- UBYTE fn_sbuf[100] = "CM.DAT";
- UBYTE fn_ubuf[100];
-
- struct StringInfo fn_txstr = {
- fn_sbuf, fn_ubuf, /* Buffer, UndoBuffer */
- 0, 100, 0, /* BufferPos, MaxChars, DispPos */
- 0, 6, /* UndoPos, NumChars */
- 0, 0, 0, /* DispCount, CLeft, CTop */
- 0x0, 0, /* LayerPtr, LongInt */
- NULL /* AltKeyMap */
- };
-
- struct Gadget fn = {
- &fnok, /* NextGadget pointer */
- 50, 20, /* LeftEdge, TopEdge */
- 300, 10, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | ENDGADGET
- | STRINGCENTER,
- /* GadgetType */
- STRGADGET
- | REQGADGET,
- (APTR)&fn_bord, /* GadgetRender */
- NULL, /* SelectRender */
- NULL, /* GadgetText */
- 0x0, /* MutualExclude */
- (APTR)&fn_txstr, /* SpecialInfo */
- FNGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
-
-
-
- /*
- * aok gadget
- */
-
-
- SHORT aok_Pairs[] = {
- 0, 0,
- 25,0,
- 25,12,
- 0, 12,
- 0, 0
- };
-
- struct Border aok_bord = {
- -1, -1, /* LeftEdge, TopEdge */
- GRNPEN,REDPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY p airs */
- (SHORT *)&aok_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
- struct IntuiText aok_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 5,2, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "OK", /* IText */
- NULL /* NextText */
- };
-
-
- struct IntuiText A_text6 = {
- ORGPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 25,11, /* LeftEdge, TopEdge */
- &TxtAt_BI, /* TextAttr */
- "Celestial Mechanics", /* IText */
- NULL /* NextText */
- };
-
- struct IntuiText A_text5 = {
- ORGPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 25,21, /* LeftEdge, TopEdge */
- &TxtAt_BI, /* TextAttr */
- " Simulator ", /* IText */
- &A_text6 /* NextText */
- };
-
- struct IntuiText A_text4 = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 25,38, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- " W. John Guineau ", /* IText */
- &A_text5 /* NextText */
- };
-
- struct IntuiText A_text3 = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 25,46, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "3 Royal Crest Dr #0", /* IText */
- &A_text4 /* NextText */
- };
-
- struct IntuiText A_text2 = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 25,54, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- " Marlboro, Ma 01752", /* IText */
- &A_text3 /* NextText */
- };
-
- struct IntuiText A_text = {
- WHTPEN,REDPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 25,62, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- " (508) 485-6233 ", /* IText */
- &A_text2 /* NextText */
- };
-
-
- struct Gadget aok = {
- NULL, /* NextGadget pointer */
- 85, 82, /* LeftEdge, TopEdge */
- 23, 10, /* Width, Height */
- /* Gadget Flags */
- GADGHCOMP,
- /* Activation Flags */
- RELVERIFY
- | ENDGADGET,
- /* GadgetType */
- BOOLGADGET
- | REQGADGET,
- (APTR)&aok_bord, /* GadgetRender */
- NULL, /* SelectRender */
- &aok_text, /* GadgetText */
- 0x0, /* MutualExclude */
- NULL, /* SpecialInfo */
- AOKGAD, /* GadgetID */
- NULL /* UserData Pointer */
- };
-
-
-
-
-
-
-
- /***********************************************************
- *
- * MENUS
- *
- ***********************************************************/
-
-
- /*
- * MenuNumber component definitions
- */
- #define M_Control 0
- #define I_Stop 0
- #define I_Start 1
-
- #define M_Edit 1
- #define I_ClearB 0
- #define I_ClearS 1
- #define I_Modify 2
- #define I_Create 3
- #define I_Setup 4
-
- #define M_File 2
- #define I_Exit 0
- #define I_SavScr 1
- #define I_SavDat 2
- #define I_LoadDat 3
- #define I_About 4
-
- /*
- * MenuNumber Shortcuts
- */
- #define MN_CStop (SHIFTMENU(M_Control)|SHIFTITEM(I_Stop)|SHIFTSUB(NOSUB))
- #define MN_CStart (SHIFTMENU(M_Control)|SHIFTITEM(I_Start)|SHIFTSUB(NOSUB))
-
- #define MN_ESetup (SHIFTMENU(M_Edit)|SHIFTITEM(I_Setup)|SHIFTSUB(NOSUB))
- #define MN_ECreate (SHIFTMENU(M_Edit)|SHIFTITEM(I_Create)|SHIFTSUB(NOSUB))
- #define MN_EMod (SHIFTMENU(M_Edit)|SHIFTITEM(I_Modify)|SHIFTSUB(NOSUB))
- #define MN_EClearS (SHIFTMENU(M_Edit)|SHIFTITEM(I_ClearS)|SHIFTSUB(NOSUB))
- #define MN_EClearB (SHIFTMENU(M_Edit)|SHIFTITEM(I_ClearB)|SHIFTSUB(NOSUB))
-
- #define MN_FAbout (SHIFTMENU(M_File)|SHIFTITEM(I_About)|SHIFTSUB(NOSUB))
- #define MN_FLDat (SHIFTMENU(M_File)|SHIFTITEM(I_LoadDat)|SHIFTSUB(NOSUB))
- #define MN_FSDat (SHIFTMENU(M_File)|SHIFTITEM(I_SavDat)|SHIFTSUB(NOSUB))
- #define MN_FSScr (SHIFTMENU(M_File)|SHIFTITEM(I_SavScr)|SHIFTSUB(NOSUB))
- #define MN_FExit (SHIFTMENU(M_File)|SHIFTITEM(I_Exit)|SHIFTSUB(NOSUB))
-
-
-
- /*
- * "File" menu subitems
- */
- struct IntuiText AboutTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "About", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem About = {
- NULL, /* next item */
- 0,0,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&AboutTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
- struct IntuiText LoadTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Load Data", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem LoadData = {
- &About, /* next item */
- 0,10,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&LoadTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
- struct IntuiText SaveDTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Save Data", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem SaveData = {
- &LoadData, /* next item */
- 0,20,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&SaveDTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
- struct IntuiText SaveSTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Save Screen", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem SaveScreen = {
- &SaveData, /* next item */
- 0,30,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&SaveSTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
- struct IntuiText ExitTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Exit", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem Exit = {
- &SaveScreen, /* next item */
- 0,40,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&ExitTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
-
-
- /*
- * "Edit" menu subitems
- */
- struct IntuiText SetupTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Setup...", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem Setup = {
- NULL, /* next item */
- 0,0,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&SetupTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
- struct IntuiText CreateTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Create...", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem Create = {
- &Setup, /* next item */
- 0,10,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&CreateTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
- struct IntuiText ModifyTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Modify...", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem Modify = {
- &Create, /* next item */
- 0,20,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&ModifyTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
- struct IntuiText ClearSTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Clear Screen", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem ClearS = {
- &Modify, /* next item */
- 0,30,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&ClearSTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
- struct IntuiText ClearBTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Clear Bodys", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem ClearB = {
- &ClearS, /* next item */
- 0,40,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&ClearBTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
-
-
- /*
- * "Control" menu subitems
- */
-
- struct IntuiText StartTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Start", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem Start = {
- NULL, /* next item */
- 0,0,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&StartTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
- struct IntuiText StopTxt = {
- BLKPEN,WHTPEN, /* FrontPen, BackPen */
- JAM1, /* DrawMode */
- 0,0, /* LeftEdge, TopEdge */
- &TxtAt_Plain, /* TextAttr */
- "Stop", /* IText */
- NULL /* NextText */
- };
-
- struct MenuItem Stop = {
- &Start, /* next item */
- 0,10,100,10, /* Left,Top Edge, Width, Height */
- ITEMENABLED /* flags */
- | ITEMTEXT
- | HIGHCOMP,
- 0L, /* MutualExclude */
- (APTR)&StopTxt, /* Name */
- 0, /* Command */
- NULL, /* SubItem */
- 0 /* NextSelect */
- };
-
-
-
- /*
- * Actual Menus
- */
- struct Menu File = {
- NULL, /* NextMenu */
- 0,0,50,0, /* Left,Top Edge, Width, Height */
- MENUENABLED, /* flags */
- "File", /* Name */
- &Exit /* First Item */
-
- };
-
- struct Menu Edit = {
- &File, /* NextMenu */
- 50,0,50,0, /* Left,Top Edge, Width, Height */
- MENUENABLED, /* flags */
- "Edit", /* Name */
- &ClearB /* First Item */
-
- };
-
- struct Menu Control = {
- &Edit, /* NextMenu */
- 100,0,90,0, /* Left,Top Edge, Width, Height */
- MENUENABLED, /* flags */
- "Control", /* Name */
- &Stop /* First Item */
-
- };
-
-
-
-
- /********************************************************
- * Requesters
- ********************************************************/
-
-
-
-
- SHORT req_Pairs[] = {
- 0, 0,
- 209, 0,
- 209, 149,
- 0, 149,
- 0, 0
- };
-
- struct Border req_bord = {
- 0, 0, /* LeftEdge, TopEdge */
- PURPEN,ORGPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&req_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
-
-
- SHORT fnr_Pairs[] = {
- 0, 0,
- 399, 0,
- 399, 59,
- 0, 59,
- 0, 0
- };
-
- struct Border fnr_bord = {
- 0, 0, /* LeftEdge, TopEdge */
- PURPEN,ORGPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&fnr_Pairs, /* XY pairs */
- NULL /* Next Border */
- };
-
-
-
- SHORT A_Pairs2[] = {
- 4, 4,
- 195, 4,
- 195, 95,
- 4, 95,
- 4, 4
- };
-
- struct Border A_bord2 = {
- 0, 0, /* LeftEdge, TopEdge */
- GRNPEN,BLUPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&A_Pairs2, /* XY pairs */
- NULL /* Next Border */
- };
-
- SHORT A_Pairs[] = {
- 0, 0,
- 199, 0,
- 199, 99,
- 0, 99,
- 0, 0
- };
-
- struct Border A_bord = {
- 0, 0, /* LeftEdge, TopEdge */
- REDPEN,GRNPEN,JAM2, /* FrontPen, BackPen, DrawMode*/
- 5, /* Count of XY pairs */
- (SHORT *)&A_Pairs, /* XY pairs */
- &A_bord2 /* Next Border */
- };
-
-
-
-
-
- struct Requester BodyInfo = {
- NULL, /* OlderRequester */
- 200,100, /* LeftEdge,TopEdge */
- 210,150, /* Width Height */
- 0,0, /* RelLeft,RelTop */
- &mass, /* gadgets */
- &req_bord, /* ReqBorder */
- &mass_text, /* text */
- NULL, /* Flags */
- REQBCK, /* BackFill (pen) */
- NULL, /* ReqLayer */
- {NULL}, /* pad */
- {NULL}, /* ImageBMap */
- NULL, /* RWindow */
- {NULL} /* pad */
- };
-
-
- struct Requester SetupInfo = {
- NULL, /* OlderRequester */
- 200,100, /* LeftEdge,TopEdge */
- 210,150, /* Width Height */
- 0,0, /* RelLeft,RelTop */
- &dt, /* gadgets */
- &req_bord, /* ReqBorder */
- &dt_text, /* text */
- NULL, /* Flags */
- REQBCK, /* BackFill (pen) */
- NULL, /* ReqLayer */
- {NULL}, /* pad */
- {NULL}, /* ImageBMap */
- NULL, /* RWindow */
- {NULL} /* pad */
- };
-
-
- struct Requester FileName = {
- NULL, /* OlderRequester */
- 100,100, /* LeftEdge,TopEdge */
- 400,60, /* Width Height */
- 0,0, /* RelLeft,RelTop */
- &fn, /* gadgets */
- &fnr_bord, /* ReqBorder */
- &fn_text, /* text */
- NULL, /* Flags */
- REQBCK, /* BackFill (pen) */
- NULL, /* ReqLayer */
- {NULL}, /* pad */
- {NULL}, /* ImageBMap */
- NULL, /* RWindow */
- {NULL} /* pad */
- };
-
-
- struct Requester RAbout = {
- NULL, /* OlderRequester */
- 200,100, /* LeftEdge,TopEdge */
- 200,100, /* Width Height */
- 0,0, /* RelLeft,RelTop */
- &aok, /* gadgets */
- &A_bord, /* ReqBorder */
- &A_text, /* text */
- NULL, /* Flags */
- BLUPEN, /* BackFill (pen) */
- NULL, /* ReqLayer */
- {NULL}, /* pad */
- {NULL}, /* ImageBMap */
- NULL, /* RWindow */
- {NULL} /* pad */
- };
-
-
-
-